import WebView from 'react-native-webview';
import { ScrollView, StatusBar, View, Button, Text, TextInput } from 'react-native';
import { TestCase, Tester, TestSuite } from '@rnoh/testerino';
import React, { useRef, useState } from 'react';

  const htmlContent = `
    <!DOCTYPE html>
    <html>
      <head>
        <title>静态页面</title>
        <style>
          body {
            font-family: Arial, sans-serif;
            padding: 20px;
          }
          h1 {
            color: #333;
          }
        </style>
      </head>
      <body>
        <h1>HTML网页</h1>
        <p>这是用来测试React-Native-WebView的HTML页面。</p>
         <p>这是用来测试React-Native-WebView的HTML页面。</p>
      </body>
    </html>
  `;

export default function WebViewTestHtml() {
  return (
        <View style={{flex:1}}>
          <Tester style={{ paddingBottom: 80 }}>
            <TestSuite name="react-native-webview">
            <TestCase
              key={'webview api html'}
              itShould={`webview api html`}
              tags={['C_API']}
              initialState={false}
              arrange={({ setState }) => {
              return (
                <View style={{ height:500,width:'100%'}}>
                  <WebView source={{ html: htmlContent}} />
                </View>
              );
            }}
            assert={async ({ expect, state }) => {
              expect(state).to.be.true;
            }}
          />
          </TestSuite>
          </Tester>
        </View>
  );
}